Skip to content

ci(audit): don't block PRs when npm's audit endpoint is retired (410) - #341

Merged
sonegillis1 merged 1 commit into
mainfrom
ci/audit-tolerate-retired-endpoint
Jul 15, 2026
Merged

ci(audit): don't block PRs when npm's audit endpoint is retired (410)#341
sonegillis1 merged 1 commit into
mainfrom
ci/audit-tolerate-retired-endpoint

Conversation

@sonegillis1

Copy link
Copy Markdown
Contributor

Problem

npm has retired the legacy audit endpoint (/-/npm/v1/security/audits) that pnpm audit (10.11.1) calls. pnpm audit --audit-level=high now exits non-zero with:

ERR_PNPM_AUDIT_BAD_RESPONSE  The audit endpoint … responded with 410:
This endpoint is being retired. Use the bulk advisory endpoint instead.

The audit job's "Fail if vulnerabilities found" step keys off that exit code and can't distinguish an endpoint outage from real findings, so it now blocks every PR — e.g. #339 (a clean @iblai/iblai-js bump whose full pre-push suite passed) failed the audit gate purely on the 410, not a vulnerability.

Fix

In the "Run pnpm audit" step, detect the 410 / ERR_PNPM_AUDIT_BAD_RESPONSE / "being retired" response and treat it as "audit unavailable" — emit a ::warning:: and don't fail. Real high/critical findings (when the endpoint responds, e.g. the nightly schedule run) still produce a non-zero code and block as before.

PR advisory coverage is unaffecteddependency-review-action (fail-on-severity: moderate, in dependency-review.yml) still gates every PR against GitHub's advisory DB, which doesn't use the retired npm endpoint.

Follow-up options (not in this PR)

The legacy endpoint isn't coming back, so pnpm audit will stay "unavailable" until either pnpm moves to the bulk advisory endpoint or we switch this job to a tool that uses it (e.g. osv-scanner, or pnpm dlx audit-ci against the bulk API). Happy to do that as a follow-up if you want the full-tree nightly audit working again — for now this unblocks PRs while keeping real-advisory enforcement via dependency-review.

🤖 Generated with Claude Code

npm retired the legacy audit endpoint that `pnpm audit` (10.11.1) calls, so it
exits non-zero with a 410 / ERR_PNPM_AUDIT_BAD_RESPONSE. The "Fail if
vulnerabilities found" step keyed off that exit code and could not distinguish
an endpoint outage from real findings, so it blocked every PR (e.g. #339, a
clean dependency bump).

Treat the 410/endpoint-retired error as "audit unavailable": warn and don't
fail. Real high/critical findings (when the endpoint responds — e.g. the
nightly run) still block. PR advisory coverage remains enforced by
dependency-review-action (fail-on-severity: moderate).
@sonegillis1
sonegillis1 requested a review from mamigot as a code owner July 15, 2026 16:44
@mamigot

mamigot commented Jul 15, 2026

Copy link
Copy Markdown
Member

Claude finished @sonegillis1's task —— View job


E2E Coverage Review

  • Dismiss stale REQUEST_CHANGES reviews (none found)
  • Identify changed files: .github/workflows/security-audit.yml, CHANGELOG.md — no new page.tsx routes
  • Run mechanical coverage check: ✅ 545 checkpoints unchanged, 25/25 files mapped (100%)
  • Apply decision logic: CASE E — approved

✅ E2E Coverage — No Issues

No new app routes were introduced. Only CI workflow and changelog files changed. All existing coverage is intact.

@mamigot mamigot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ E2E Coverage — No Issues

No new app routes were introduced. All existing coverage is intact.

@sonegillis1
sonegillis1 merged commit 9eb6621 into main Jul 15, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants